import { createWebHistory, createRouter } from 'vue-router'

import HomeView from '../views/home/index.vue'
import Login from '../views/login.vue'
import Detail from '../views/detail.vue'

//二级路由
import Sy from '../views/home/sy.vue'
import Classify from '../views/home/classify.vue'
import Shopping from '../views/home/shopping.vue'
import My from '../views/home/my.vue'
const routes = [
    { path: '/login', component: Login },
    { path: '/detail', component: Detail },
  { 
    path: '/home',
     component: HomeView,
     children:[
        { path: '/home', redirect: '/home/sy' },
        { path: 'sy', component: Sy },
        { path: 'classify', component: Classify },
        { path: 'shopping', component: Shopping },
        { path: 'my', component: My },
     ]
     },
]

const router = createRouter({
  history: createWebHistory(),
  routes,
})

export default router